using UnityEngine;
using VoxelEngine.UI;

namespace VoxelEngine
{
	[CreateAssetMenu(menuName = "Voxel/WorldData")]
	public class WorldData : ScriptableObject
	{
		[SerializeField]
		private string _worldId;

		[SerializeField]
		private Vector3 _spawnPosition;

		[SerializeField]
		private Vector3 _spawnOrientation;

		[SerializeField]
		private Color _fogColor = new Color(0f, 0.682f, 1f, 1f);

		[SerializeField]
		private ResourceAsset _serializedWorldAsset;

		[SerializeField]
		private Material _opaqueMaterialAsset;

		[SerializeField]
		private Material _transparentMaterialAsset;

		[SerializeField]
		private Material _cutoutMaterialAsset;

		[SerializeField]
		private Material _particlesMaterialAsset;

		[SerializeField]
		private Material _skydomeMaterialAsset;

		[SerializeField]
		private BlockSelectionData _blockSelectionAsset;

		[SerializeField]
		private ResourceAsset _blockBaseListAsset;

		[SerializeField]
		private ResourceAsset _npcAsset;

		[SerializeField]
		private ResourceAsset _lowEndnpcAsset;

		[SerializeField]
		private ResourceAsset _particlesAsset;

		public string WorldId
		{
			get
			{
				return _worldId;
			}
			set
			{
				_worldId = value;
			}
		}

		public Vector3 SpawnPosition
		{
			get
			{
				return _spawnPosition;
			}
			set
			{
				_spawnPosition = value;
			}
		}

		public Vector3 SpawnOrientation
		{
			get
			{
				return _spawnOrientation;
			}
			set
			{
				_spawnOrientation = value;
			}
		}

		public ResourceAsset NPCs
		{
			get
			{
				return _npcAsset;
			}
			set
			{
				_npcAsset = value;
			}
		}

		public ResourceAsset LowEndNPCs
		{
			get
			{
				return _lowEndnpcAsset;
			}
			set
			{
				_lowEndnpcAsset = value;
			}
		}

		public ResourceAsset Particles
		{
			get
			{
				return _particlesAsset;
			}
			set
			{
				_particlesAsset = value;
			}
		}

		public bool HasNPCs => _npcAsset != null && !_npcAsset.IsEmpty;

		public bool HasParticles => _particlesAsset != null && !_particlesAsset.IsEmpty;

		public ResourceAsset SerializedWorld
		{
			get
			{
				return _serializedWorldAsset;
			}
			set
			{
				_serializedWorldAsset = value;
			}
		}

		public Material OpaqueMaterial
		{
			get
			{
				return _opaqueMaterialAsset;
			}
			set
			{
				_opaqueMaterialAsset = value;
			}
		}

		public Material TransparentMaterial
		{
			get
			{
				return _transparentMaterialAsset;
			}
			set
			{
				_transparentMaterialAsset = value;
			}
		}

		public Material CutoutMaterial
		{
			get
			{
				return _cutoutMaterialAsset;
			}
			set
			{
				_cutoutMaterialAsset = value;
			}
		}

		public Material ParticleMaterial
		{
			get
			{
				return _particlesMaterialAsset;
			}
			set
			{
				_particlesMaterialAsset = value;
			}
		}

		public Material SkydomeMaterial
		{
			get
			{
				return _skydomeMaterialAsset;
			}
			set
			{
				_skydomeMaterialAsset = value;
			}
		}

		public BlockSelectionData BlockSelection
		{
			get
			{
				return _blockSelectionAsset;
			}
			set
			{
				_blockSelectionAsset = value;
			}
		}

		public BlockBaseList BlockBaseList => _blockBaseListAsset.Asset<BlockBaseList>();

		public Color FogColor
		{
			get
			{
				return _fogColor;
			}
			set
			{
				_fogColor = value;
			}
		}

		public ResourceAsset BlockBaseListAsset
		{
			get
			{
				return _blockBaseListAsset;
			}
			set
			{
				_blockBaseListAsset = value;
			}
		}
	}
}
